package com.linghu.service;

import com.linghu.dao.EmployeeDAO;
import com.linghu.domain.Employee;

/**
 * @author 令狐荣豪
 * @version 1.0
 * 该类完成对employee表的各种操作(通过调用EmployeeDAO对象完成)
 */
public class EmployeeService {

    //定义一个EmployeeDAO属性
   private EmployeeDAO employeeDAO=new EmployeeDAO();

   //方法：根据empId 和 pwd 返回一个Employee对象
    //查询不到则返回null
    public Employee getEmployeeByIdAndPwd(String empId,String pwd){
        Employee employee =
                employeeDAO.querySingle("select * from employee where empId=? and pwd=md5(?)", Employee.class, empId,pwd);
        return employee;
    }

}
